package com.syx.system.Controller.user;

import com.syx.commoncore.Constant.HttpConstants;
import com.syx.commoncore.Model.Result;
import com.syx.commoncore.Model.TableDataInfoResult;
import com.syx.system.Model.user.DTO.UserQueryDTO;
import com.syx.system.Model.user.DTO.UserUpdateStatusDTO;
import com.syx.system.Service.IUserService;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/user")
@RestController
public class UserController {
    @Resource
    IUserService iUserService;

    @GetMapping("/list")
    public TableDataInfoResult list(UserQueryDTO userQueryDTO){
        return iUserService.list(userQueryDTO);


    }

    //拉黑的话限制用户操作，解禁的话放开用户操作
    @PutMapping ("/updateStatus")
    public Result<Void> updateStatus(@Valid @RequestBody UserUpdateStatusDTO userUpdateStatusDTO, @RequestHeader(HttpConstants.AUTHENTICATION) String token){
        return iUserService.updateStatus(userUpdateStatusDTO,token);



    }






}
